/*~-1*/
/*~XSF_LANGUAGE: C/C++*/
/*~A:1*/
/*~+:File Header*/
/*~T*/
/****************************************************************************
 * 
 ****************************************************************************/

/*~E:A1*/
/*~A:2*/
/*~+:Import*/
/*~T*/
/* Import                                                                      */

/*~T*/
/* generic definitions */
#include "general.h"

/*~T*/
#include "init.h"
#include "actuator.h"
#include "line.h"
#include "bsl_com.h"
#include <avr/io.h>

/*~T*/
/* own header file */
#include "main.h"

/*~T*/

/*~E:A2*/
/*~A:3*/
/*~+:Configuration*/
/*~T*/

/*~E:A3*/
/*~A:4*/
/*~+:Private Definitions           */
/*~A:5*/
/*~+:Private Constant Definitions */
/*~T*/
/* Private Variable Definitions                                                */

/*~T*/
static const u8 bsl_ID_code[1] = {0x00};
static const u8 bsl_code_1[32] = {0xe7,0x58,0xa6,0x00,0xe6,0xf0,0x5f,0xfa,
                                  0x7e,0xb7,0x9a,0xb7,0xfe,0x70,0xa4,0x00,
                                  0xb2,0xfe,0x86,0xf0,0x8f,0xfa,0x3d,0xf8,
                                  0xea,0x00,0x60,0xfa,0xcc,0x00,0xcc,0x00};
static const u8 bsl_code_2[48] = {0xE7,0x58,0xA6,0x00,0x5F,0xEB,0xE6,0xF0,
                                  0xFF,0xBF,0x7E,0xB7,0x5F,0xEA,0x5E,0xEA,
                                  0x9A,0xB7,0xFC,0x70,0xA4,0x00,0xB2,0xFE,
                                  0x86,0xF0,0x8F,0xFA,0x3D,0xF6,0xEA,0x00,
                                  0x60,0xFA,0xCC,0x00,0xCC,0x00,0xCC,0x00,
                                  0xCC,0x00,0xCC,0x00,0xCC,0x00,0xCC,0x00};
/*~E:A5*/
/*~A:6*/
/*~+:Private Variable Definitions */
/*~T*/
/* Private Variable Definitions                                                */

/*~T*/
static u8 lv_prg_start;

/*~E:A6*/
/*~T*/

/*~E:A4*/
/*~A:7*/
/*~+:Private Functions*/
/*~T*/
/* Private Functions                                                           */

/*~T*/

/*~E:A7*/
/*~A:8*/
/*~+:Main project entry*/
/*~F:9*/
void main(void)
/*~-1*/
{
   /*~T*/
   /* init IO line directions */
   io_init();

   /*~T*/
   /* init the input line read module */
   line_init();

   /*~T*/
   /* init the button read module */
   com_init();

   /*~T*/
   /* init the actuator control module */
   act_init();

   /*~L:10*/
   while (1)
   /*~-1*/
   {
      /*~A:11*/
      /*~+:check DO1*/
      /*~+:*/
      /*~I:12*/
      if (line_status(DO1))
      /*~-1*/
      {
         /*~T*/
         act_set(BOOT_EN,1);
         /*~T*/

      /*~-1*/
      }
      /*~O:I12*/
      /*~-2*/
      else
      {
         /*~I:13*/
         if (act_read(BOOT_EN))
         /*~-1*/
         {
            /*~T*/
            act_set(BOOT_EN,0);
         /*~-1*/
         }
         /*~E:I13*/
      /*~-1*/
      }
      /*~E:I12*/
      /*~E:A11*/
   /*~-1*/
   }
   /*~E:L10*/
/*~-1*/
}
/*~E:F9*/
/*~E:A8*/
/*~T*/

